package Day06;

public class Demo01 {
    //方法的重载
    public static void main(String[] args) {
        Math m = new Math();
        int c = m.sum(10,20);
        System.out.println(c);
        double x = m.sum(10.2,2.5);
        System.out.println(x);//方法中sum相同，但里面的参数类型不同，构成方法重载
        int b = m.sum(10,20,30);
        System.out.println(b);

    }
}
class Math{
    int sum(int x, int y){
        int z = x + y;
        return z;
    }
    double sum(double x, int y){
        double z = x + y;
        return z;
    }
    double sum(double x, double y){
        double z = x + y;
        return z;
    }
    int sum(int a, int b, int c){
        int z = a + b + c;
        return z;
    }
}
